﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="FileExtension.cs" company="">
//   
// </copyright>
// <summary>
//   The file extension.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace Libium.Core
{
    /// <summary>
    ///   The file extension.
    /// </summary>
    public static class FileExtension
    {
        #region Public Methods and Operators

        /// <summary>
        /// The copy to.
        /// </summary>
        /// <param name="file">
        /// The file. 
        /// </param>
        /// <param name="destinationFile">
        /// The destination file. 
        /// </param>
        public static void CopyTo(this IFile file, IFile destinationFile)
        {
            using (var sourceStream = file.GetReadStream())
            {
                using (var destinationStream = destinationFile.GetWriteStream())
                {
                    sourceStream.CopyTo(destinationStream);
                }
            }
        }

        #endregion
    }
}